<template>
  <div class="device">
    <iframe 
      v-if="iframeUrl"
      frameborder="0"
      class="wrap"
      :src="iframeUrl" />
  </div>
</template>

<script>
import { tokenStorageKey } from 'common/js/config'
import { getStorage } from 'common/js/utils'

export default {
  name: 'device',
  created () {
    this.iframeUrl = 'https://219.128.72.158:28900/iot-main/iframePage/inspectTaskIframe?access_token=' + getStorage(tokenStorageKey).token
  },
  beforeDestroy () {
    this.iframeUrl = ''
  },
  data () {
    return {
      iframeUrl: ''
    }
  }
}
</script>

<style lang="scss" scoped>
.device {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  .wrap {
    width: 100%;
    height: 100%;
    position: relative;
  }
}
</style>
